import { http } from "./request";
const api = {
  login: "/user/login",
  register: "/user/register",
  getNotice: "/notice/getNotice",
  getRoom: "/room/getRoom",
  addRoom: "/room/addRoom",
  updateRoom: "/room/updateRoom",
  deleteRoom: "/room/deleteRoom",
  updateOwn: "/user/updateOwn",
  getReserve: "/reserve/getReserve",
  getRoomSites: "/site/getRoomSites",
  bookSite: "/site/bookSite",
  getPostComment: "/comment/getPostComment",
  commentRoom: "/comment/commentRoom",
  removeOwnComment: "/comment/removeOwnComment",
  commentPostAnswer: "/comment/commentPostAnswer",
  addNotice: "/notice/addNotice",
  updateNotice: "/notice/updateNotice",
  deleteNotice: "/notice/deleteNotice",
  upload: "/common/upload",
  lockSite: "/site/lockSite",
  getRoomNum: "/reserve/getRoomNum",
  getUserById: "/user/getUserById",
  userSign: "/sign/userSign",
  getSignInfo: "/sign/getSignInfo",
  getUserNotSign: "/sign/getUserNotSign",
  sign:'/sign/clear'
};

export const login = (data = {}) => {
  return http<string>({
    url: api.login,
    method: "post",
    data,
  });
};
export const userRegister = (data = {}) => {
  return http({
    url: api.register,
    method: "post",
    data,
  });
};
export const getNotice = (params = {}) => {
  return http({
    url: api.getNotice,
    method: "get",
    params,
  });
};
export const getRoom = (params = {}) => {
  return http({
    url: api.getRoom,
    method: "get",
    params,
  });
};
export const updateOwn = (data = {}) => {
  return http({
    url: api.updateOwn,
    method: "put",
    data,
  });
};
export const getReserve = (params = {}) => {
  return http({
    url: api.getReserve,
    method: "get",
    params,
  });
};
export const getRoomSites = (params = {}) => {
  return http({
    url: api.getRoomSites,
    method: "get",
    params,
  });
};
export const bookSite = (data = {}) => {
  return http({
    url: api.bookSite,
    method: "post",
    data,
  });
};
export const getPostComment = (params = {}) => {
  return http({
    url: api.getPostComment,
    method: "get",
    params,
  });
};
export const commentRoom = (data = {}) => {
  return http({
    url: api.commentRoom,
    method: "post",
    data,
  });
};
export const removeOwnComment = (params = {}) => {
  return http({
    url: api.removeOwnComment,
    method: "get",
    params,
  });
};
export const commentPostAnswer = (data = {}) => {
  return http({
    url: api.commentPostAnswer,
    method: "post",
    data,
  });
};
export const addNotice = (data = {}) => {
  return http({
    url: api.addNotice,
    method: "post",
    data,
  });
};
export const updateNotice = (data = {}) => {
  return http({
    url: api.updateNotice,
    method: "post",
    data,
  });
};
export const deleteNotice = (params = {}) => {
  return http({
    url: api.deleteNotice,
    method: "post",
    params,
  });
};
export const addRoom = (data = {}) => {
  return http({
    url: api.addRoom,
    method: "post",
    data,
  });
};
export const deleteRoom = (data = {}) => {
  return http({
    url: api.deleteRoom,
    method: "post",
    data,
  });
};
export const upload = (data = {}) => {
  return http({
    url: api.upload,
    method: "post",
    data,
  });
};
export const lockSite = (data = {}) => {
  return http({
    url: api.lockSite,
    method: "post",
    data,
  });
};
export const getRoomNum = (params = {}) => {
  return http({
    url: api.getRoomNum,
    method: "get",
    params,
  });
};
export const getUserById = (params = {}) => {
  return http({
    url: api.getUserById,
    method: "get",
    params,
  });
};
export const userSign = (params = {}) => {
  return http({
    url: api.userSign,
    method: "post",
    params,
  });
};
export const getSignInfo = (params = {}) => {
  return http({
    url: api.getSignInfo,
    method: "get",
    params,
  });
};
export const getUserNotSign = (params = {}) => {
  return http({
    url: api.getUserNotSign,
    method: "get",
    params,
  });
};
export const signClear = (params = {}) => {
  return http({
    url: api.sign,
    method: "post",
    params,
  });
};
